Don't fail readDB on empty dirs.
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Tue, 13 Sep 2005 21:00:13 +0000 (21:00 +0000)
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Tue, 13 Sep 2005 21:00:13 +0000 (21:00 +0000)
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
tools/python/xen/xend/xenstore/xsobj.py

index 7037568e785b706548cac9edd27b2af2f36e488c..9e58534c39e7ae5f5b1243c4ba916bc55f1373f8 100644 (file)
@@ -485,9 +485,11 @@ class DBMap(dict):
         if self.__db__ is None:
             return
         self.__data__ = self.__db__.getData()
-        for k in self.__db__.ls():
-            n = self.addChild(k)
-            n.readDB()
+        l = self.__db__.ls()
+        if l:
+            for k in l:
+                n = self.addChild(k)
+                n.readDB()
         self.__dirty__ = False
 
     def readChildDB(self, k):